﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="BaseRepository.cs" company="Rabid Dog Labs">
//   Rabid Dog Labs
// </copyright>
// <summary>
//   Base Repository Definition
// </summary>
// --------------------------------------------------------------------------------------------------------------------
using System.Collections.Generic;
using TeamCommunitySolution.Domain.DataLayer.Base;

namespace TeamCommunitySolution.Repositories.Base
{
    /// <summary>
    /// Base Repository Definition
    /// </summary>
    public interface BaseRepository
    {
        /// <summary>
        /// Saves the user.
        /// </summary>
        /// <param name="user">
        /// The user to save.
        /// </param>
        void SaveUser(SystemUser user);

        /// <summary>
        /// Gets the user by field.
        /// </summary>
        /// <param name="fieldName">
        /// Name of the field.
        /// </param>
        /// <param name="fieldValue">
        /// The field value.
        /// </param>
        /// <returns>
        /// System User instance.
        /// </returns>
        SystemUser GetUserByField(string fieldName, string fieldValue);

        /// <summary>
        /// Saves the message.
        /// </summary>
        /// <param name="messageInbox">
        /// The message inbox.
        /// </param>
        /// <param name="messageOutbox">
        /// The message outbox.
        /// </param>
        void SaveMessage(MessageInbox messageInbox, MessageOutbox messageOutbox);

        /// <summary>
        /// Gets the inbox message.
        /// </summary>
        /// <param name="id">
        /// The id of the message.
        /// </param>
        /// <returns>
        /// Message Inbox.
        /// </returns>
        MessageInbox GetInboxMessage(string id);

        /// <summary>
        /// Gets the outbox message.
        /// </summary>
        /// <param name="id">
        /// The id of the message.
        /// </param>
        /// <returns>
        /// Message outbox instance.
        /// </returns>
        MessageOutbox GetOutboxMessage(string id);

        /// <summary>
        /// The save team.
        /// </summary>
        /// <param name="team">
        /// The team to save.
        /// </param>
        void SaveTeam(ref Team team);

        /// <summary>
        /// Gets the team by field.
        /// </summary>
        /// <param name="fieldName">Name of the field.</param>
        /// <param name="fieldValue">The field value.</param>
        /// <returns>The team instance.</returns>
        Team GetTeamByField(string fieldName, string fieldValue);

        /// <summary>
        /// Saves the team invite.
        /// </summary>
        /// <param name="invite">The invite.</param>
        void SaveTeamInvite(TeamInvite invite);

        /// <summary>
        /// Searches the name of the system user by.
        /// </summary>
        /// <param name="name">The name of the user.</param>
        /// <returns>List of system users.</returns>
        IList<SystemUser> SearchSystemUserByName(string name);

        /// <summary>
        /// Gets the team invite by field.
        /// </summary>
        /// <param name="fieldName">Name of the field.</param>
        /// <param name="fieldValue">The field value.</param>
        /// <returns>Team Invite.</returns>
        TeamInvite GetTeamInviteByField(string fieldName, string fieldValue);

        /// <summary>
        /// Deletes the team invite.
        /// </summary>
        /// <param name="id">The id of the team invite.</param>
        void DeleteTeamInvite(string id);
    }
}